package com.lagou.edu.course.api;

import com.lagou.edu.common.result.ResponseDTO;
import com.lagou.edu.course.api.dto.CourseDTO;
import com.lagou.edu.course.api.dto.PageResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import com.lagou.edu.course.api.param.CourseQueryParam;
/**
 * @author limeng
 */
@FeignClient(name = "${remote.feign.edu-course-boot.name:edu-course-boot}", path = "/course")
public interface CourseBossRemoteService {

    /**
     * 保存/更新课程
     * @param courseDTO
     * @return
     */
    @PostMapping(value = "/saveOrUpdateCourse",consumes = "application/json")
    ResponseDTO saveOrUpdateCourse(@RequestBody CourseDTO courseDTO);

    /**
     * 获取选课列表
     * @return
     */
    @GetMapping("/getAllCourses")
    List<CourseDTO> getAllCourses();

    /**
     * 获取课程详情
     * @param courseId 课程ID required
     * @return
     */
    @GetMapping("/getCourseById")
    CourseDTO getCourseById(@RequestParam("courseId") Integer courseId);

    /**
     * 分页查询
     * @param courseQueryParam
     * @return
     */
    @PostMapping(value = "/getQueryCourses",consumes = "application/json")
    PageResultDTO<CourseDTO> getQueryCourses( @RequestBody CourseQueryParam courseQueryParam);

    /**
     * 课程上下架
     * @param courseId 课程ID not required
     * @param status 课程状态，0-草稿，1-上架 not required
     * @return
     */
    @GetMapping("/changeState")
    ResponseDTO changeState(@RequestParam("courseId")Integer courseId, @RequestParam("status")Integer status);


    /**
     * 获取已购课程信息
     * @param userId
     * @return
     *
     @GetMapping("/getPurchasedCourse")
     List<CourseDTO> getPurchasedCourse(@RequestParam("userId") Integer userId);
     */
}
